You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The state tag is used in communication between interpreter and motion. Data put into it usually comes from double sized types and got truncated to float size. Afterwards, the values would, for example, be moved to HAL pins and the truncated value would be extended to double again. This is obviously a bad plan.
This PR makes the state tag field_float of double type.
Need to take care here. What about changes to emcmot_hal_data->interp_feedrate?
Its defined as hal_float_t *interp_feedrate;
Not to mention my pending ones in #3995
Which leads me to suggest another change to resolve the active_tags mess this touches which I was leaving unitil #3995 was committed.
add an extra float/double array to state_tags
double fields_extra_float[EX_FIELD_MAX_FIELDS]
Move all new pins in #3995 to this field and lock fields_float to the original fields (up to GM_FIELD_FLOAT_NAIVE_CAM_TOLERANCE) with an assert statement and apropiate comments in state_tags.h
The name hal_float_t is a complete misnomer and not a C-type float. The underlying type is actually a double.
The name "float" is used many places in linuxCNC, but most float types were promoted to double because you need the precision in the calculation. The variable names and defined did not change, only the underlying type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The state tag is used in communication between interpreter and motion. Data put into it usually comes from double sized types and got truncated to float size. Afterwards, the values would, for example, be moved to HAL pins and the truncated value would be extended to double again. This is obviously a bad plan.
This PR makes the state tag field_float of double type.